<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/epoll.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">epoll.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="epoll_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __EPOLL_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __EPOLL_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../../tools/tools.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// epoll句柄封装</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html">    8</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_epoll_handle.html">EpollHandle</a></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;{</div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a3fee32d2be4a53531332b28ad23dec6d">   10</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="struct_epoll_handle.html#a3fee32d2be4a53531332b28ad23dec6d">hEpoll</a>;             <span class="comment">// epoll创建的句柄</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a751f06cef526fd2ad3911627b3635f29">   11</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="struct_epoll_handle.html#a751f06cef526fd2ad3911627b3635f29">hCompleteEvent</a>;     <span class="comment">// 某个IO操作完成事件句柄</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a27eed59c512cd99f71c30783e5d95e2c">   12</a></span>&#160;    <a class="code" href="tools_8h.html#ac3247c51e4e3de674affb32998e133e2">BOOL</a> <a class="code" href="struct_epoll_handle.html#a27eed59c512cd99f71c30783e5d95e2c">_dealComplete</a>;     <span class="comment">// 标识是否在处理完成队列，用以减少Post惊醒epoll_wait的次数</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a6747853f601e39af4108d109d89edf1d">   13</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="struct_epoll_handle.html#a6747853f601e39af4108d109d89edf1d">hTimeout</a>;           <span class="comment">// 超时句柄</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a3424492adbf9497f4006f48b839c2866">   14</a></span>&#160;    <a class="code" href="tools_8h.html#ae1e6edbbc26d6fbc71a90190d0266018">UINT32</a> <a class="code" href="struct_epoll_handle.html#a3424492adbf9497f4006f48b839c2866">time_events</a>;     <span class="comment">// 超时事件</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a178c1a82426cafe3535ad01f1e1cefac">   15</a></span>&#160;    <a class="code" href="struct_epoll_handle.html#a178c1a82426cafe3535ad01f1e1cefac">EpollHandle</a>()</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        <a class="code" href="struct_epoll_handle.html#a3fee32d2be4a53531332b28ad23dec6d">hEpoll</a> = <a class="code" href="struct_epoll_handle.html#a751f06cef526fd2ad3911627b3635f29">hCompleteEvent</a> = -1;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        <a class="code" href="struct_epoll_handle.html#a6747853f601e39af4108d109d89edf1d">hTimeout</a> = -1;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        <a class="code" href="struct_epoll_handle.html#a3424492adbf9497f4006f48b839c2866">time_events</a> = 0;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        <a class="code" href="struct_epoll_handle.html#a27eed59c512cd99f71c30783e5d95e2c">_dealComplete</a> = <a class="code" href="tools_8h.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a>;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    }</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a6efc7b125043abcae0aea25f01820de9">   23</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="struct_epoll_handle.html#a6efc7b125043abcae0aea25f01820de9">ResetComplete</a>(<a class="code" href="tools_8h.html#ac3247c51e4e3de674affb32998e133e2">BOOL</a>* b)</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    {</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        *b = <a class="code" href="tools_8h.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a>;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    }</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="struct_epoll_handle.html#a9e82114533d2bb511e3c8649dac568c7">   28</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="tools_8h.html#ac3247c51e4e3de674affb32998e133e2">BOOL</a>* <a class="code" href="struct_epoll_handle.html#a9e82114533d2bb511e3c8649dac568c7">SetComplete</a>(<a class="code" href="tools_8h.html#ac3247c51e4e3de674affb32998e133e2">BOOL</a>* b)</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    {</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;        *b = <a class="code" href="tools_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <span class="keywordflow">return</span> b;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    }</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;};</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#endif // __EPOLL_H__</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="atools_8h_html_aa8cecfc5c5c054d2875c03e77b7be15d"><div class="ttname"><a href="tools_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a></div><div class="ttdeci">#define TRUE</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00147">tools.h:147</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a27eed59c512cd99f71c30783e5d95e2c"><div class="ttname"><a href="struct_epoll_handle.html#a27eed59c512cd99f71c30783e5d95e2c">EpollHandle::_dealComplete</a></div><div class="ttdeci">BOOL _dealComplete</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00012">epoll.h:12</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a3fee32d2be4a53531332b28ad23dec6d"><div class="ttname"><a href="struct_epoll_handle.html#a3fee32d2be4a53531332b28ad23dec6d">EpollHandle::hEpoll</a></div><div class="ttdeci">int hEpoll</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00010">epoll.h:10</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a6efc7b125043abcae0aea25f01820de9"><div class="ttname"><a href="struct_epoll_handle.html#a6efc7b125043abcae0aea25f01820de9">EpollHandle::ResetComplete</a></div><div class="ttdeci">static void ResetComplete(BOOL *b)</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00023">epoll.h:23</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a751f06cef526fd2ad3911627b3635f29"><div class="ttname"><a href="struct_epoll_handle.html#a751f06cef526fd2ad3911627b3635f29">EpollHandle::hCompleteEvent</a></div><div class="ttdeci">int hCompleteEvent</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00011">epoll.h:11</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a9e82114533d2bb511e3c8649dac568c7"><div class="ttname"><a href="struct_epoll_handle.html#a9e82114533d2bb511e3c8649dac568c7">EpollHandle::SetComplete</a></div><div class="ttdeci">static BOOL * SetComplete(BOOL *b)</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00028">epoll.h:28</a></div></div>
<div class="ttc" id="atools_8h_html_aa93f0eb578d23995850d61f7d61c55c1"><div class="ttname"><a href="tools_8h.html#aa93f0eb578d23995850d61f7d61c55c1">FALSE</a></div><div class="ttdeci">#define FALSE</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00148">tools.h:148</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html"><div class="ttname"><a href="struct_epoll_handle.html">EpollHandle</a></div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00008">epoll.h:8</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a3424492adbf9497f4006f48b839c2866"><div class="ttname"><a href="struct_epoll_handle.html#a3424492adbf9497f4006f48b839c2866">EpollHandle::time_events</a></div><div class="ttdeci">UINT32 time_events</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00014">epoll.h:14</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a178c1a82426cafe3535ad01f1e1cefac"><div class="ttname"><a href="struct_epoll_handle.html#a178c1a82426cafe3535ad01f1e1cefac">EpollHandle::EpollHandle</a></div><div class="ttdeci">EpollHandle()</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00015">epoll.h:15</a></div></div>
<div class="ttc" id="atools_8h_html_ac3247c51e4e3de674affb32998e133e2"><div class="ttname"><a href="tools_8h.html#ac3247c51e4e3de674affb32998e133e2">BOOL</a></div><div class="ttdeci">unsigned int BOOL</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00137">tools.h:137</a></div></div>
<div class="ttc" id="atools_8h_html_ae1e6edbbc26d6fbc71a90190d0266018"><div class="ttname"><a href="tools_8h.html#ae1e6edbbc26d6fbc71a90190d0266018">UINT32</a></div><div class="ttdeci">unsigned int UINT32</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00140">tools.h:140</a></div></div>
<div class="ttc" id="astruct_epoll_handle_html_a6747853f601e39af4108d109d89edf1d"><div class="ttname"><a href="struct_epoll_handle.html#a6747853f601e39af4108d109d89edf1d">EpollHandle::hTimeout</a></div><div class="ttdeci">int hTimeout</div><div class="ttdef"><b>Definition:</b> <a href="epoll_8h_source.html#l00013">epoll.h:13</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
